package com.zhb.cloud.service.plant.active.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.zhb.cloud.plant.active.mapper.PrizeMapper;
import com.zhb.cloud.plant.active.model.Prize;
import com.zhb.cloud.plant.active.service.PrizeService;

@Service
@Transactional
public class PrizeServiceImpl implements PrizeService {
	@Autowired
	private PrizeMapper prizeMapper;

	@Override
	public Prize findById(String id) {
		return prizeMapper.selectByPrimaryKey(id);
	}

	@Override
	public int saveModel(Prize model) {
		return prizeMapper.insertSelective(model);
	}

	@Override
	public int updateModel(Prize model) {
		return prizeMapper.updateByPrimaryKeySelective(model);

	}

	@Override
	public int deleteModel(String id) {
		return prizeMapper.deleteByPrimaryKey(id);
	}

	@Override
	public long totalAmount(Prize model, Object... objects) {
		return 0;
	}

	@Override
	public int batchInsert(List<Prize> prizes) {
		return prizeMapper.batchInsert(prizes);
	}

	@Override
	public List<Prize> findAllPrize() {
		return prizeMapper.findAllPrize();
	}

}
